import java.util.Scanner;
public class Q622 {
    public static double sqrt(long n){
        double Lastguess=1;
        double nextguess;
        while (true){
            nextguess=(Lastguess+n/Lastguess)/2;
            if (Math.abs(nextguess-Lastguess)<0.0001){
                break;
            }
            Lastguess=nextguess;
        }
        return nextguess;
    }
    public static void main(String[] args){
        long num;
        System.out.print("enter a num: ");
        Scanner input=new Scanner(System.in);
        num= input.nextLong();
        double result=sqrt(num);
        System.out.print("the square root of "+num+"is approximately "+result);
    }
}
